package com.hue.springcloud.mapper;

import com.hue.springcloud.domain.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface OrderMapper {
    //创建订单
    @Insert("insert into t_order values(null,#{userId},#{productId},#{count},#{money},0)")
    public void createOrder(Order order);

    //修改状态
    @Update("update t_order set status=#{status} where id=#{id}")
    public void updateStatus(@Param("id")long id,@Param("status") int status);
}
